package com.kfm.wiki.entity;

import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;

/**
 * 用户
 * @TableName user
 */
@Data
public class User implements Serializable {
    /**
     * ID
     */
    private Long id;

    /**
     * 登录名
     */
    @NotEmpty(message = "【登录名】不能为空")
    @Length(min = 5, max = 20, message = "【登录名】应在 5 ~ 20 个字符")
    private String loginName;

    /**
     * 昵称
     */
    @NotEmpty(message = "【昵称】不能为空")
    private String name;

    /**
     * 密码
     */
    @NotEmpty(message = "【密码】不能为空")
    @Length(min = 6, message = "【密码】应在 6 ~ 20 个字符")
    private String password;

    /*
     *  用户 token
     */
    @TableField(exist = false)
    private String token;

    private static final long serialVersionUID = 1L;
}